<template>
  <div class>
      <crumbs attribute1='权限管理' attribute2='权限列表'></crumbs>
    <el-card class="box-card">
      <el-table :data="tablist" stripe border style="width: 100%">
        <el-table-column label="#" width="80" type="index"></el-table-column>
        <el-table-column prop="authName" label="权限名称" width="180"></el-table-column>
        <el-table-column prop="path" label="路径"></el-table-column>
        <el-table-column prop="level" label="权限路径">
           <template slot-scope="scope">
                <el-tag v-if="scope.row.level == '0'">一级</el-tag>
                <el-tag type="success" v-if="scope.row.level == '1'">二级</el-tag>
                <el-tag type="warning" v-if="scope.row.level == '2'">三级</el-tag>
           </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getAuthorList } from "@/http/api";
export default {
  created() {
    this.getData();
  },

  data() {
    return {
      tablist: []
    };
  },
  mounted() {},
  methods: {
    getData() {
      getAuthorList().then(res => {
        this.tablist = res;
      });
    }
  },
  components: {}
};
</script>

<style lang='scss' scoped>
.text {
  font-size: 14px;
}

.item {
  padding: 18px 0;
}

.box-card {
  margin: 15px 0;
  width: 100%;
}
</style>
